package com.mark.web.bill.enums;

/**
 * @Description: 加工零件商品的枚举值
 * @Author: Mark
 * @CreateDate: 2019/2/2 22:53
 * @Version: 2.0
 * @Copyright : 豆浆油条个人非正式工作室
 */
public enum  GoodsEnum {

    AVAILABLE(1, "可用"),
    FORBIDDEN(2,"禁用");

    private int state;
    private String desc;

    GoodsEnum(int state, String desc) {
        this.state = state;
        this.desc = desc;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String stateOf(int state){
        for(GoodsEnum goodsEnum :values()){
            if(goodsEnum.getState() == state){
                return goodsEnum.getDesc();
            }
        }
        return "未知！";
    }
}
